const { v4: uuidv4 } = require('uuid');
// 生成随机字符串，每次执行不能发生，游客身份持久存储
export const getUUID=()=>{
  // 先从本地存储中获取uuid，看一下本地存储是否有
  let uuid_token =localStorage.getItem('UUIDTOKEN');
  if(!uuid_token){
    uuid_token=uuidv4()
    localStorage.setItem('UUIDTOKEN',uuid_token)
  }
  //切记有返回值,没有返回值undefined
  return uuid_token;
}